Android runtime: do not use std::remove.

This fixes an issue of arrays not being freed in Android 5.