Add workaround for https://issues.apache.org/jira/browse/DBCP-358