Just to clarify - this crash isn't caused by pymel - it's caused by the loading of certain "standard" maya plugins (sceneAssembly and xgen being two that I know of). The reason why it happens when you import pymel, as opposed to just maya.standalone.initialize(), is that pymel mimics "standard" maya startup, and executes (among other things) the user's prefs/pluginPrefs.mel - that is, it loads all plugins set to autoload.
For instance, if you do this:
import maya.standalone
maya.standalone.initialize()
import maya.cmds as cmds
cmds.loadPlugin('sceneAssembly')
exit()
...then you will get a similar crash on exit. It's a bug that we've reported several times to Autodesk. There's a sort of workaround in pymel itself - you can enable it by doing this:
import pymel.core as pm
from pymel.internal.startup import fixMayapy2011SegFault
fixMayapy2011SegFault()
This basically does what Michał Frątczak suggested above, except it includes some extra stuff that makes it try to detect if there was a non-zero exit code, and exit using that... so you can still test the return code from mayapy, and have it be meaningful. It's not bulletproof though... for instance, if you do:
mayapy -c "import pymel.core as pm; from pymel.internal.startup import fixMayapy2011SegFault; fixMayapy2011SegFault(); exit(3)"
or even:
mayapy -c "import pymel.core as pm; from pymel.internal.startup import fixMayapy2011SegFault; fixMayapy2011SegFault(); 1/0"
...it will return non-zero exit codes... but if you do:
mayapy -c "import pymel.core as pm; from pymel.internal.startup import fixMayapy2011SegFault; fixMayapy2011SegFault(); raise SystemExit(5)"
...it won't.