avoid throwing an exception just for detecting valid time zones

It certainly throws an exception upon an unknown timezone. The fix is also not correct, as "new DateTimeZone()" accepts more then just tzids.