Fix exception caught when mtime_map parent dir does not exist

This fixes an exception that was introduced in 342a6ae. Also, using
os.error does not catch IOError execeptions, so this has been changed as
well.