smalloc: check if obj has external data

+fixed couple of tests

/cc @trevnorris