Optimize detecting recursion in spl autoload