Make sure output stream are closed when writing out catalog.xml
Merge branch 'master' of git://github.com/geoserver/geoserver