[io] Specialize stream-lock on <stream>.

Previously, stream-lock was specialized on <basic-stream> which is
where the lock is actually defined in the code. However, lock-stream
and unlock-stream are specialized on <stream> and the default
implementation calls stream-lock (which isn't available for all
<stream> instances).

This also makes the test for this pass in the io-test-suite.
Merge pull request #839 from waywardmonkeys/stream-lock-specification

[io] Specialize stream-lock on <stream>.