Fixed file locking on ReleaseReader_Shapefile and added flushing to
Writer when closing Factory.