Fix test.cpp compile error

On gcc 4.7 this error happens:

    test.cpp: In function 'int main(int, char**)':
    test.cpp:28:13: error: 'close' was not declared in this scope

Ubuntu 12.10 onwards has gcc >=4.7 and thus cannot compile this file.