Check mapistore folder modify permission retval and set retval accordingly
Add debugging to track down potential mapistore failures in emsmdb code