actually close the datasource and remove debugging output littering PHPs error log
add debug logging macros to log to PHPs error log
fix memoryleaks in ogr-part of the module