SERVER-13635 fix registerStorageEngine to take ownership of and free factory