REST-50. Fix a performance issue that was causing massive slowdowns.

In order to fix the issue about checking whether or not a table is valid, the
initial implementation checked the metatable for each request which was causing
a major slowdown. The solution now is to let the first request to a deleted
table fail and then remove that table for future use so that future calls will
return a 404 instead of hanging and throwing a 500.

Reviewer: lsheng