Tests: improve fastcgi keepalive tests.

On some platforms fastcgi_keepalive.t tests failed due to problems in
handling of data split into multiple packets.  Harden tests to fail
on all platforms by adding more sleeps, and mark them as TODO till
underlying problems are fixed.

Additionally, add some padding testing.
diff --git a/fastcgi_keepalive.t b/fastcgi_keepalive.t
index 4e2664b..0181553 100644
--- a/fastcgi_keepalive.t
+++ b/fastcgi_keepalive.t
@@ -68,16 +68,26 @@
 like(http_get('/redir'), qr/302/, 'fastcgi redirect');
 like(http_get('/'), qr/^request: 3$/m, 'fastcgi third request');
 
+TODO: {
+local $TODO = 'not yet';
+
 like(http_get('/single'), qr/^connection: 1$/m, 'single connection used');
 
+}
+
 # New connection to fastcgi application should be established after HEAD
 # requests since nginx doesn't read whole response (as it doesn't need
 # body).
 
 unlike(http_head('/head'), qr/SEE-THIS/, 'no data in HEAD');
 
+TODO: {
+local $TODO = 'not yet';
+
 like(http_get('/after'), qr/^connection: 2$/m, 'new connection after HEAD');
 
+}
+
 ###############################################################################
 
 # Simple FastCGI responder implementation.  Unlike FCGI and FCGI::Async it's
@@ -110,8 +120,11 @@
 
 	# stdout
 	$h->{socket}->write(pack("CCnnCx", $h->{version}, 6, $h->{id},
-		length($body), 0));
+		length($body), 8));
 	$h->{socket}->write($body);
+	select(undef, undef, undef, 0.1);
+	$h->{socket}->write(pack("xxxxxxxx"));
+	select(undef, undef, undef, 0.1);
 
 	# write some text to stdout and stderr splitted over multiple network
 	# packets to test if we correctly set pipe length in various places
@@ -124,7 +137,9 @@
 	$h->{socket}->write($tt . pack("CC", $h->{version}, 7));
 	select(undef, undef, undef, 0.1);
 	$h->{socket}->write(pack("nnCx", $h->{id}, length($tt), 0));
+	select(undef, undef, undef, 0.1);
 	$h->{socket}->write($tt);
+	select(undef, undef, undef, 0.1);
 
 	# close stdout
 	$h->{socket}->write(pack("CCnnCx", $h->{version}, 6, $h->{id}, 0, 0));
@@ -133,6 +148,7 @@
 
 	# end request
 	$h->{socket}->write(pack("CCnnCx", $h->{version}, 3, $h->{id}, 8, 0));
+	select(undef, undef, undef, 0.1);
 	$h->{socket}->write(pack("NCxxx", 0, 0));
 }